﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class SPAParameters : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public SPAParameters(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(SPAParameters obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~SPAParameters()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_SPAParameters(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public SPAParameters.SPA_ADJUST adjust_mode
		{
			get
			{
				SPAParameters.SPA_ADJUST result = (SPAParameters.SPA_ADJUST)GlobalsPINVOKE.SPAParameters_adjust_mode_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_adjust_mode_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public SPAParameters.SPA_GRID grid_mode
		{
			get
			{
				SPAParameters.SPA_GRID result = (SPAParameters.SPA_GRID)GlobalsPINVOKE.SPAParameters_grid_mode_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_grid_mode_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public SPAParameters.SPA_TRIANG_MODE triang_mode
		{
			get
			{
				SPAParameters.SPA_TRIANG_MODE result = (SPAParameters.SPA_TRIANG_MODE)GlobalsPINVOKE.SPAParameters_triang_mode_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_triang_mode_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double surface_tol
		{
			get
			{
				double result = GlobalsPINVOKE.SPAParameters_surface_tol_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_surface_tol_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double normal_tol
		{
			get
			{
				double result = GlobalsPINVOKE.SPAParameters_normal_tol_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_normal_tol_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double max_edge_length
		{
			get
			{
				double result = GlobalsPINVOKE.SPAParameters_max_edge_length_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_max_edge_length_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double grid_aspect_ratio
		{
			get
			{
				double result = GlobalsPINVOKE.SPAParameters_grid_aspect_ratio_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_grid_aspect_ratio_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public int max_grid_lines
		{
			get
			{
				int result = GlobalsPINVOKE.SPAParameters_max_grid_lines_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_max_grid_lines_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public int min_u_grid_lines
		{
			get
			{
				int result = GlobalsPINVOKE.SPAParameters_min_u_grid_lines_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_min_u_grid_lines_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public int min_v_grid_lines
		{
			get
			{
				int result = GlobalsPINVOKE.SPAParameters_min_v_grid_lines_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_min_v_grid_lines_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public bool bUseFacetRES
		{
			get
			{
				bool result = GlobalsPINVOKE.SPAParameters_bUseFacetRES_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.SPAParameters_bUseFacetRES_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public SPAParameters() : this(GlobalsPINVOKE.new_SPAParameters(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool IsEqual(SPAParameters other)
		{
			bool result = GlobalsPINVOKE.SPAParameters_IsEqual(this.swigCPtr, SPAParameters.getCPtr(other));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;

		public enum SPA_ADJUST
		{
			SPA_ADJUST_NONE,
			SPA_ADJUST_NON_GRID,
			SPA_ADJUST_ALL
		}

		public enum SPA_GRID
		{
			SPA_GRID_NONE,
			SPA_GRID_INTERIOR,
			SPA_GRID_TO_EDGES,
			SPA_GRID_ONE_DIR
		}

		public enum SPA_TRIANG_MODE
		{
			SPA_TRIANG_NONE,
			SPA_TRIANG_ALL,
			SPA_TRIANG_FRINGE_1,
			SPA_TRIANG_FRINGE_2,
			SPA_TRIANG_FRINGE_3,
			SPA_TRIANG_FRINGE_4
		}
	}
}
